Public Class Theme 

    Private Sub Theme_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadIcon(Me)

        Me.cboTheme.Text = My.Settings.Theme


        'Dim RegThemeName As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Vis\\Theme", True)
        'If RegThemeName Is Nothing Then
        '    Me.cboTheme.Text = "Money Twins"
        'Else
        '    Me.cboTheme.Text = RegThemeName.GetValue("")
        'End If

    End Sub



    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If Me.cboTheme.Text = "" Then
            MsgBox("Please Select a Theme", MsgBoxStyle.Exclamation)
            Exit Sub
        End If

        Me.DefaultLookAndFeel1.LookAndFeel.SkinName = Me.cboTheme.Text
        My.Settings.Theme = Me.cboTheme.Text
        Me.Close()
        'Dim RegThemeName As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Vis\\Theme", True)
        'If RegThemeName Is Nothing Then
        '    Dim RegCreateThemeName As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Vis\\Theme")
        '    RegCreateThemeName.SetValue("", Me.cboTheme.Text)
        'Else
        '    RegThemeName.SetValue("", Me.cboTheme.Text)
        'End If

        'Try
        '    Dim RegThemeName_ As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Vis\\Theme", True)
        '    If RegThemeName_ Is Nothing Then
        '    Else
        '        ThemeSkinName = RegThemeName_.GetValue("")
        '        Me.DefaultLookAndFeel1.LookAndFeel.SkinName = ThemeSkinName
        '    End If
        'Catch ex As Exception

        'End Try

        'MsgBox("Application Need to Restart to Take Effect", MsgBoxStyle.Information)
        'Me.Close()
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub cboTheme_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTheme.SelectedIndexChanged
        Me.DefaultLookAndFeel1.LookAndFeel.SkinName = Me.cboTheme.Text
    End Sub
End Class